package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/9/26.
 */
@Entity
@Table(name = "blacklist", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class BlacklistEntity extends IAcross
{
    public BlacklistEntity()
    {
        super();
    }

    public BlacklistEntity(IAcross ia)
    {
        super(ia);
    }

    private int blId;
    private Integer userId;
    private String reason;
    private Integer createId;
    private Timestamp createDate;
    private Integer level;
    private UserEntity userEntity;
    private UserEntity createUser;
private List<BlacklistEntity> blacklistEntityList;
    @Id
    @Column(name = "bl_id")
    @GeneratedValue
    public int getBlId() {
        return blId;
    }

    public void setBlId(int blId) {
        this.blId = blId;
    }

    @Basic
    @Column(name = "user_Id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "reason")
    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "level")
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BlacklistEntity that = (BlacklistEntity) o;

        if (blId != that.blId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (level != null ? !level.equals(that.level) : that.level != null) return false;
        if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = blId;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (reason != null ? reason.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (level != null ? level.hashCode() : 0);
        return result;
    }

    @Transient
    public UserEntity getUserEntity() {
        return userEntity;
    }

    public void setUserEntity(UserEntity userEntity) {
        this.userEntity = userEntity;
    }
    @Transient
    public UserEntity getCreateUser() {
        return createUser;
    }

    public void setCreateUser(UserEntity createUser) {
        this.createUser = createUser;
    }

    @Transient
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<BlacklistEntity> getBlacklistEntityList() {
        return blacklistEntityList;
    }

    public void setBlacklistEntityList(List<BlacklistEntity> blacklistEntityList) {
        this.blacklistEntityList = blacklistEntityList;
    }
}
